home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-02-16 | 1.7 KB | 40 lines | [TEXT/GEOL] |
- Item 4977851 15-Feb-90 11:05PST
-
- From: D5295 Reseach SW Design, D Goldman,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- Sub: Undoable commands
-
- I'm having trouble figuring out how to do something which I'm SURE must be easy
- to accomplish. Help!
-
- I've got this TControl. If the user clicks in most parts of the control, either
- nothing should happen, or else I want to perform a straightforward non-undoable
- command. All of that is easy, and works fine. But if the user mouses-up in a
- certain part of the control, I want to perform a certain *undoable* command.
-
- What needs to happen, somewhere, is a gApplication.CommitLastCommand and then a
- gApplication.PerformCommand(myCommand).
-
- My problem is that we're performing a TControlTracker command when my TControl.
- TrackMouse sees the mouse-up. We need to let TControlTracker.TrackMouse return
- gNoChanges, and then somehow tell MacApp to perform my new undoable command.
- (Simply having TrackMouse return myCommand won't work.)
-
- I thought of having TrackMouse explicitly do the CommitLastCommand and the
- PerformCommand, but this doesn't work. PerformCommand does an
- UnloadAllSegments, and TControlTracker is apparently in a non-resident segment.
- Of course, if this is ALL that is wrong with this approach, I could change the
- segment mapping, but I take this obstacle as an indication that I'm not going
- about this in the correct way.
-
- Bottom line (simple???) question: how do you get a mouse-tracking command
- object to create and perform a different command object?
-
- -- Perplexed in Portland,
- Dave
-
- (Please send/copy your reply directly to me at D5295; I'm not on MacApp.Tech$)
-
-